<?php
namespace App\Lib\PHPExcel\ManuOrder;

use App\Lib\PHPExcel\ExcelHandle;

class TaobaoOrder extends ExcelHandle
{
    /*
     *退货订单
     * */
    public function arrange($origin_arr)
    {

        $arr = [
            0 => [
                '订单号', '会员名','支付宝账号','产品名','实际支付金额', '店铺', '状态','收货人','电话', '地址','头条昵称','创建时间','支付时间','导入时间','宝贝种类','修改后地址','快递公司','运单号','总数','是否手机下单','关闭原因','支付详情','应付金额','邮费','支付积分','总金额','返点积分','实际支付积分','备注','留言','配送方式'
            ]
        ];
        $i = 1;
        foreach ($origin_arr as $data) {
            $arr[$i]['订单号'] = $data['order_id'];
            $arr[$i]['会员名'] = $data['buyer_nickname'];
            $arr[$i]['支付宝账号'] = $data['buyer_zfb'];
            $arr[$i]['产品名'] = $data['prod_name'];
            $arr[$i]['实际支付金额'] = $data['actual_payment_amount'];
            $arr[$i]['店铺'] = $data['shop_name'];
            $arr[$i]['状态'] = $data['order_status'];
            $arr[$i]['收货人'] = $data['post_recevier'];
            $arr[$i]['电话'] = $data['post_tel'];
            $arr[$i]['地址'] = $data['post_address'];
            $arr[$i]['头条昵称'] = $data['nickname'];
            $arr[$i]['创建时间'] = $data['create_time'];
            $arr[$i]['支付时间'] = $data['payment_time'];
            $arr[$i]['导入时间'] = $data['created_at'];
            $arr[$i]['宝贝种类'] = $data['prod_type'];
            $arr[$i]['修改后地址'] = $data['modify_address'];
            $arr[$i]['快递公司'] = $data['logistics_comp'];
            $arr[$i]['运单号'] = $data['logistics_code'];
            $arr[$i]['总数'] = $data['prod_total_amount'];
            $arr[$i]['是否手机下单'] = $data['order_type'];
            $arr[$i]['关闭原因'] = $data['cancel_reason'];
            $arr[$i]['支付详情'] = $data['payment_detail'];
            $arr[$i]['应付金额'] = $data['payment_amount'];
            $arr[$i]['邮费'] = $data['feight_payment_amount'];
            $arr[$i]['支付积分'] = $data['payment_integral'];
            $arr[$i]['总金额'] = $data['total_amount'];
            $arr[$i]['返点积分'] = $data['return_integral'];
            $arr[$i]['实际支付积分'] = $data['actual_payment_integral'];
            $arr[$i]['备注'] = $data['remark'];
            $arr[$i]['留言'] = $data['buyer_words'];
            $arr[$i]['配送方式'] = $data['delivery_mode'];
            $i++;
        }

        return $arr;
    }


}